<template>
  <div class="card flex-col">
    <div class="card-title">
      <div>{{ title }}</div>
      <div class="subtitle">{{ subtitle }}</div>
    </div>
    <div class="card-count">{{ totalNum }}</div>
    <div class="p1" @click="toDetail" v-if="title !== '账单数量'">
      <p>查看详情 <i class="el-icon-arrow-right" /></p>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    detailUrl: String,
    title: String,
    subtitle: String,
    totalNum: Number,
  },
  methods: {
    toDetail(id) {
      const routerURl = this.$router.resolve({
        path: this.detailUrl,
      });
      window.open(routerURl.href, "_blank");
    },
  },
};
</script>
<style lang="scss">
.card-table {
  & thead {
    color: #010101;
  }
}
</style>

<style lang="scss" scoped>
.card {
  padding: 20px;
  border-radius: 4px;
  text-align: center;
  border: 1px solid rgba(221, 221, 221, 100);
  height: 260px;
  position: relative;
}

.p1 {
  cursor: pointer;
  color: #5ac6b7;
  position: absolute;
  right: 10px;
  bottom: 0;
}

.card-title {
  display: flex;
  justify-content: space-between;
  color: #414141;
  font-size: 16px;
  text-align: left;
  font-weight: bold;
  .subtitle {
    color: gray;
  }
}

.card-count {
  margin-top: 57px;
  color: #414141;
  font-size: 56px;
  font-weight: bold;
}

.card-increase {
  margin: 10px auto 56px;
  color: #414141;
  font-size: 16px;
}

.table-address {
  position: relative;
  margin: 0;
  color: #4e7afb;
  max-height: 40px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.real-estate-num {
  color: #5ac6b7;
  cursor: pointer;
}
</style>
